<template>
  <div class="air_topInfo">
    <div class="air_quality">
      <p class="quality_title">{{ AirAnimateObj.category }}</p>
      <div class="air_aim">
        <i class="air_i"></i>
        <i
          class="air_btn"
          :style="{ left: AirAnimateObj.aqi / 250 + 'rem' }"
        ></i>
      </div>
      <p class="air_null">{{ AirAnimateObj.aqi }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "AirAnimate",
  data() {
    return {};
  },
  props: {
    AirAnimateObj: Object,
    // 空气质量指数，大于300按337算
    air_aqi() {
      return this.AirAnimateObj.aqi >= 300 ? 337 : this.AirAnimateObj.aqi;
    },
  },
};
</script>

<style scoped>
.air_topInfo {
  width: 100%;
  height: auto;
}
.air_topInfo .air_quality {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  font-size: 0.16rem;
}
.air_topInfo .air_quality .air_null {
  font-weight: 600;
  right: 0;
}
.air_topInfo .air_quality .air_aim {
  position: relative;
  width: 1.5rem;
  height: 0.1rem;
  background-image: linear-gradient(to right, #ffb199 0%, #ff0844 100%);
  border-radius: 0.1rem;
}
.air_btn {
  position: absolute;
  top: 50%;
  width: 0.15rem;
  height: 0.15rem;
  margin-top: -0.075rem;
  border-radius: 50%;
  background-color: rgba(225, 225, 225, 0.9);
}
.air_topInfo .air_quality .air_aim .air_i {
  display: block;
  width: 100%;
  height: 100%;
}
</style>